#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "qextserialport.h"
#include "ui_mainwindow.h"
#include "settingsdialog.h"
class CpuPlot;

class MainWindow : public QMainWindow,public Ui::MainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    QextSerialPort *myCom;
    PortSettings  *myPortSettings;
    QString  *myPortName;
    settingsDialog *Dialog;
    QTimer* timer;
    QDialog* vBox;//画图
    CpuPlot *plot;
    QByteArray* temp;
    qint16 ymin,ymax;
signals:
    void popPacketData(QByteArray *p);
private slots:
    void on_exitBtn_clicked();
    void on_plotBtn_clicked();
    void on_clearBtn_clicked();
    void setPortSettings(const PortSettings& portSettings);
    void setPortName(const QString&);
    void on_settingsBtn_clicked();
    void on_sendMsgBtn_clicked();
    void on_closeComBtn_clicked();
    void on_openComBtn_clicked();
    void readMyCom();
    void minAxisScaleChanged(int newMin);
    void maxAxisScaleChanged(int newMax);
};

#endif // MAINWINDOW_H
